<ui:composition template="/resources/templates/loginTemplate.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets">

    <ui:define name="loginContent">
        <h:panelGroup id="loginPanel" layout="block" styleClass="block-frame">
            <h:panelGroup id="loginPanel_pg1" styleClass="top" layout="block">
                <h:panelGroup id="loginPanel_pg2" layout="block">
                    <h:panelGroup id="loginPanel_pg3" layout="block"> </h:panelGroup>
                </h:panelGroup>
            </h:panelGroup>

            <h:panelGroup styleClass="middle" layout="block">
                <h:form id="loginForm" styleClass="block-body">
                    <h:panelGroup id="header" styleClass="block-header" layout="block">
                        <h:outputLabel id="headeLabel" value="#{msgs['login_form']}"/>
                    </h:panelGroup>

                    <h:panelGroup styleClass="block-content-p" layout="block">
                        <h:panelGrid columns="2">
                            <h:outputLabel id="userNameLabel" value="#{msgs['user']}:" for="j_username"
                                           styleClass="margin1"/>
                            <h:inputText id="j_username" value="#{loginFormBean.userName}"/>
                            <h:outputLabel id="passwordLabel" value="#{msgs['password']}:" for="j_password"
                                           styleClass="margin1"/>
                            <h:inputSecret id="j_password" value="#{loginFormBean.password}"/>
                        </h:panelGrid>
                        <h:panelGroup id="submit" styleClass="margin1 centerAlign" layout="block">
                            <h:commandButton id="j_submitLogin" value="#{msgs['enter']}"
                                             action="#{loginController.loginUsingSpringAuthenticationManager}"/>
                        </h:panelGroup>
                        <h:panelGroup id="errors" styleClass="padding1" layout="block">
                            <h:messages id="loginErrorMessages" errorStyle="color: red" warnStyle="color: blue;"
                                        infoStyle="color: green;"/>
                        </h:panelGroup>
                    </h:panelGroup>
                </h:form>
            </h:panelGroup>
            <h:panelGroup id="loginPanel_pg4" styleClass="bottom" layout="block">
                <h:panelGroup id="loginPanel_pg5" layout="block">
                    <h:panelGroup id="loginPanel_pg6" layout="block"> </h:panelGroup>
                </h:panelGroup>
            </h:panelGroup>
        </h:panelGroup>
    </ui:define>
</ui:composition>
